﻿namespace UnitTests
{
    using Contoso.Math.MathLibrary;
    using Microsoft.VisualStudio.TestTools.UnitTesting;

    /// <summary>
    /// Unit tests for the MathLibrary.
    /// </summary>
    [TestClass]
    public class MathLibraryTests
    {
        /// <summary>
        /// Unit test for the GenerateSequence method.
        /// </summary>
        [TestMethod]
        public void GenerateSequenceTest()
        {
            long[] fActual;
            long[] fExpected = { 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 };

            fActual = Fibonacci.GenerateSequence(10);

            if (fActual.Length == 10)
            {
                for (int i = 0; i < 10; i++)
                {
                    Assert.AreEqual<long>(fExpected[i], fActual[i]);
                }
            }
            else
            {
                Assert.Fail();
            }
        }
    }
}
